package com.funo.business.entities;
// default package

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;


/**
 * ProductItem entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name="T_PRODUCT_ITEM"
    ,schema="UNIBASE"
)
@DynamicInsert
@DynamicUpdate
public class ProductItem  implements java.io.Serializable {


    // Fields    

     private String productItemId;
     private String productItemName;
     private String description;
     private int isValid;
     private Date insertDt;
     
     private Company company;


    // Constructors

    /** default constructor */
    public ProductItem() {
    }

    
    /** full constructor */
    public ProductItem(String productItemName, String description,Company company) {
        this.productItemName = productItemName;
        this.description = description;
        this.company = company ;
    }

   
    // Property accessors
//    @GenericGenerator(name="generator", strategy="uuid.hex") @GeneratedValue(generator="generator")
    
    @Id
    @Column(name="PRODUCT_ITEM_ID", unique=true, nullable=false, length=40)

    public String getProductItemId() {
        return this.productItemId;
    }
    
    public void setProductItemId(String productItemId) {
        this.productItemId = productItemId;
    }
    
    @Column(name="PRODUCT_ITEM_NAME", nullable=false, length=32)

    public String getProductItemName() {
        return this.productItemName;
    }
    
    public void setProductItemName(String productItemName) {
        this.productItemName = productItemName;
    }
    
    @Column(name="DESCRIPTION", length=200)

    public String getDescription() {
        return this.description;
    }
    
    public void setDescription(String description) {
        this.description = description;
    }
    
    @Column(name="IS_VALID", nullable=false, precision=1, scale=0,insertable=false)

    public int getIsValid() {
        return this.isValid;
    }
    
    public void setIsValid(int isValid) {
        this.isValid = isValid;
    }
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="INSERT_DT", length=7,insertable=false,updatable=false)

    public Date getInsertDt() {
        return this.insertDt;
    }
    
    public void setInsertDt(Date insertDt) {
        this.insertDt = insertDt;
    }

    @ManyToOne
    @JoinColumn(name="COMPANY_ID")
	public Company getCompany() {
		return company;
	}


	public void setCompany(Company company) {
		this.company = company;
	}
   
    







}